# Contributor: Anees PK <anees6478@gmail.com>
# Maintainer: Anees PK <anees6478@gmail.com>
pkgname=py3-keepalive
pkgver=0.5
_pkgname=keepalive
pkgrel=5
pkgdesc="urllib keepalive support for python"
url="https://github.com/wikier/keepalive"
arch="noarch"
license="LGPL-2.1-or-later"
depends="python3"
makedepends="py3-setuptools py3-gpep517 py3-wheel py3-installer"
subpackages="$pkgname-doc $pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/k/$_pkgname/$_pkgname-$pkgver.tar.gz
https://raw.githubusercontent.com/wikier/$_pkgname/master/README.md
	py3.patch
	fix-import.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	# no proper testsuite
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -c 'from keepalive import HTTPHandler'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm0644 "$srcdir"/README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="
f5a7a2113d87aafda42fbbefe0ca6af27986dbac59cdd76f6f66b858b8a66c7b792d93324e3c77009fac80b10996f74bad631935118617a49703e111db3e68a8  keepalive-0.5.tar.gz
1cc046e36aa7697a5a96755bdd5f55916f0a3b97508ce51105affc694e3935910bfb88d6065808e3bc489b0aae01d77c6f7c60f193b551fe760949dd3bb78582  README.md
174795226911e8a7b55c02c0d5aa608ff4d6fac83a6a1632d69c252f280be26c205ddb03ec37c5f9cc55fa38ae536a54812f4d61bbabaa9a1be1314ac1d8c299  py3.patch
25d0cd481908ac39cdfe699bf1ba1a920b51ef620ebbb47b9dabb8fb4a6d446c7028edd26494c4067590fac4464b6e92aac0b92be4a3c0c7fb227b99768d0a3b  fix-import.patch
"
